.class public Lcom/waiqin365/base/db/zydk/f;
.super Ljava/lang/Object;


# static fields
.field private static a:Lcom/waiqin365/base/db/zydk/f;


# instance fields
.field private b:Lcom/waiqin365/base/db/zydk/a;

.field private c:Lcom/waiqin365/base/db/zydk/d;

.field private d:Landroid/database/sqlite/SQLiteDatabase;

.field private e:Lcom/waiqin365/base/db/zydk/TixingItemDao;


# direct methods
.method private constructor <init>(Landroid/content/Context;)V
    .locals 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/fiberhome/gaea/client/c/b;->b()Lcom/fiberhome/gaea/client/c/b;

    move-result-object v1

    invoke-virtual {v1}, Lcom/fiberhome/gaea/client/c/b;->g()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "data/db/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v2

    if-nez v2, :cond_0

    invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z

    :cond_0
    new-instance v1, Lcom/waiqin365/base/db/zydk/b;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "tixing.db"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v2, 0x0

    invoke-direct {v1, p1, v0, v2}, Lcom/waiqin365/base/db/zydk/b;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)V

    invoke-virtual {v1}, Lcom/waiqin365/base/db/zydk/b;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->d:Landroid/database/sqlite/SQLiteDatabase;

    new-instance v0, Lcom/waiqin365/base/db/zydk/a;

    iget-object v1, p0, Lcom/waiqin365/base/db/zydk/f;->d:Landroid/database/sqlite/SQLiteDatabase;

    invoke-direct {v0, v1}, Lcom/waiqin365/base/db/zydk/a;-><init>(Landroid/database/sqlite/SQLiteDatabase;)V

    iput-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->b:Lcom/waiqin365/base/db/zydk/a;

    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->b:Lcom/waiqin365/base/db/zydk/a;

    sget-object v1, Lde/greenrobot/dao/identityscope/IdentityScopeType;->None:Lde/greenrobot/dao/identityscope/IdentityScopeType;

    invoke-virtual {v0, v1}, Lcom/waiqin365/base/db/zydk/a;->a(Lde/greenrobot/dao/identityscope/IdentityScopeType;)Lcom/waiqin365/base/db/zydk/d;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->c:Lcom/waiqin365/base/db/zydk/d;

    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->c:Lcom/waiqin365/base/db/zydk/d;

    invoke-virtual {v0}, Lcom/waiqin365/base/db/zydk/d;->a()Lcom/waiqin365/base/db/zydk/TixingItemDao;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    return-void
.end method

.method public static declared-synchronized a(Landroid/content/Context;)Lcom/waiqin365/base/db/zydk/f;
    .locals 2

    const-class v1, Lcom/waiqin365/base/db/zydk/f;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/waiqin365/base/db/zydk/f;->a:Lcom/waiqin365/base/db/zydk/f;

    if-nez v0, :cond_0

    new-instance v0, Lcom/waiqin365/base/db/zydk/f;

    invoke-direct {v0, p0}, Lcom/waiqin365/base/db/zydk/f;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/waiqin365/base/db/zydk/f;->a:Lcom/waiqin365/base/db/zydk/f;

    :cond_0
    sget-object v0, Lcom/waiqin365/base/db/zydk/f;->a:Lcom/waiqin365/base/db/zydk/f;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v1

    return-object v0

    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method


# virtual methods
.method public a(J)Lcom/waiqin365/base/db/zydk/e;
    .locals 3

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    invoke-virtual {v0}, Lcom/waiqin365/base/db/zydk/TixingItemDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    sget-object v1, Lcom/waiqin365/base/db/zydk/TixingItemDao$Properties;->a:Lde/greenrobot/dao/Property;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    invoke-virtual {v1, v2}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v1

    const/4 v2, 0x0

    new-array v2, v2, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v0, v1, v2}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    invoke-virtual {v0}, Lde/greenrobot/dao/query/QueryBuilder;->unique()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/base/db/zydk/e;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :try_start_1
    monitor-exit p0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method public a()Ljava/util/List;
    .locals 4

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    invoke-virtual {v0}, Lcom/waiqin365/base/db/zydk/TixingItemDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    const/4 v1, 0x1

    new-array v1, v1, [Lde/greenrobot/dao/Property;

    const/4 v2, 0x0

    sget-object v3, Lcom/waiqin365/base/db/zydk/TixingItemDao$Properties;->a:Lde/greenrobot/dao/Property;

    aput-object v3, v1, v2

    invoke-virtual {v0, v1}, Lde/greenrobot/dao/query/QueryBuilder;->orderAsc([Lde/greenrobot/dao/Property;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    invoke-virtual {v0}, Lde/greenrobot/dao/query/QueryBuilder;->list()Ljava/util/List;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v0

    :try_start_1
    monitor-exit p0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method public a(Lcom/waiqin365/base/db/zydk/e;)Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    invoke-virtual {v0, p1}, Lcom/waiqin365/base/db/zydk/TixingItemDao;->insertOrReplace(Ljava/lang/Object;)J
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const/4 v0, 0x1

    :try_start_1
    monitor-exit p0

    :goto_0
    return v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method public b()Ljava/util/List;
    .locals 4

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    invoke-virtual {v0}, Lcom/waiqin365/base/db/zydk/TixingItemDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    sget-object v1, Lcom/waiqin365/base/db/zydk/TixingItemDao$Properties;->f:Lde/greenrobot/dao/Property;

    const/4 v2, 0x1

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    invoke-virtual {v1, v2}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v1

    const/4 v2, 0x0

    new-array v2, v2, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v0, v1, v2}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    const/4 v1, 0x1

    new-array v1, v1, [Lde/greenrobot/dao/Property;

    const/4 v2, 0x0

    sget-object v3, Lcom/waiqin365/base/db/zydk/TixingItemDao$Properties;->a:Lde/greenrobot/dao/Property;

    aput-object v3, v1, v2

    invoke-virtual {v0, v1}, Lde/greenrobot/dao/query/QueryBuilder;->orderAsc([Lde/greenrobot/dao/Property;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    invoke-virtual {v0}, Lde/greenrobot/dao/query/QueryBuilder;->list()Ljava/util/List;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v0

    :try_start_1
    monitor-exit p0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method public b(J)Z
    .locals 5

    const/4 v0, 0x0

    monitor-enter p0

    :try_start_0
    iget-object v1, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    invoke-virtual {v1}, Lcom/waiqin365/base/db/zydk/TixingItemDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v1

    sget-object v2, Lcom/waiqin365/base/db/zydk/TixingItemDao$Properties;->a:Lde/greenrobot/dao/Property;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v2, v3}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v2

    const/4 v3, 0x0

    new-array v3, v3, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v1, v2, v3}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v1

    invoke-virtual {v1}, Lde/greenrobot/dao/query/QueryBuilder;->buildDelete()Lde/greenrobot/dao/query/DeleteQuery;

    move-result-object v1

    invoke-virtual {v1}, Lde/greenrobot/dao/query/DeleteQuery;->executeDeleteWithoutDetachingEntities()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const/4 v0, 0x1

    :try_start_1
    monitor-exit p0

    :goto_0
    return v0

    :catch_0
    move-exception v1

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method public c()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/db/zydk/f;->e:Lcom/waiqin365/base/db/zydk/TixingItemDao;

    invoke-virtual {v0}, Lcom/waiqin365/base/db/zydk/TixingItemDao;->deleteAll()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const/4 v0, 0x1

    :try_start_1
    monitor-exit p0

    :goto_0
    return v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method
